import config from "@/config"
import http from "@/utils/request"


export default {
    list: {
        url: `${config.API_URL}/course/list-page`,
        name: "获取列表",
        get: async function (params) {
            return await http.get(this.url, params);
        }
    },
    action: {
        url: `${config.API_URL}/course`,
        name: "用户操作",
        get: async function (params) {
            return await http.get(this.url, params);
        },
        post: async function (params) {
            return await http.post(this.url, params);
        },
        put: async function (params) {
            return await http.put(this.url, params);
        },
        delete: async function (params) {
            return await http.delete(this.url, params);
        }
    },
    grammarS:{
        list:{
            url: `${config.API_URL}/course-grammar-package/list`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        action: {
            url: `${config.API_URL}/course-grammar-package`,
            name: "用户操作",
            POST: async function (params) {
                return await http.post(this.url, params);
            },
            PUT: async function (params) {
                return await http.put(this.url, params);
            },
            delete: async function (params) {
                return await http.delete(this.url, params);
            }
        },
    },
    courseW:{
        list:{
            url: `${config.API_URL}/course-writing/list`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        Unitlist:{
            url: `${config.API_URL}/course-writing/Unitlist`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        Typelist:{
            url: `${config.API_URL}/course-writing/Typelist`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        Modelist:{
            url: `${config.API_URL}/course-writing/Modelist`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
       writingInfo:{
           url: `${config.API_URL}/course-writing/writing-info`,
           name: "详情",
           get: async function (params) {
               return await http.get(this.url, params);
           }
       },
        action: {
            url: `${config.API_URL}/course-writing`,
            name: "用户操作",
            POST: async function (params) {
                return await http.post(this.url, params);
            },
            PUT: async function (params) {
                return await http.put(this.url, params);
            },
            delete: async function (params) {
                return await http.delete(this.url, params);
            }
        },
    },
    grammarVocabulary:{
        list:{
            url: `${config.API_URL}/course-grammar-vocabulary/list`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        import: {
            url: `${config.API_URL}/course-grammar-vocabulary/import`,
            name: "词汇导入",
            post: async function (params) {
                return await http.post(this.url, params);
            },
        },
        action: {
            url: `${config.API_URL}/course-grammar-vocabulary`,
            name: "用户操作",
            POST: async function (params) {
                return await http.post(this.url, params);
            },
            PUT: async function (params) {
                return await http.put(this.url, params);
            },
            delete: async function (params) {
                return await http.delete(this.url, params);
            }
        },
    },
    vocabulary: {
        list: {
            url: `${config.API_URL}/course-vocabulary/list-page`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        import: {
            url: `${config.API_URL}/course-vocabulary/import`,
            name: "词汇导入",
            post: async function (params) {
                return await http.post(this.url, params);
            },
        },
        action: {
            url: `${config.API_URL}/course-vocabulary`,
            name: "用户操作",
            post: async function (params) {
                return await http.post(this.url, params);
            },
            put: async function (params) {
                return await http.put(this.url, params);
            },
            delete: async function (params) {
                return await http.delete(this.url, params);
            }
        },
        batch: {
            url: `${config.API_URL}/course-vocabulary/batch`,
            name: "批量删除",
            delete: async function (params) {
                return await http.delete(this.url, params);
            }
        }
    },
    category: {
        list: {
            url: `${config.API_URL}/course-category/list-page`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        all: {
            url: `${config.API_URL}/course-category/all`,
            name: "获取所有",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        action: {
            url: `${config.API_URL}/course-category`,
            name: "用户操作",
            post: async function (params) {
                return await http.post(this.url, params);
            },
            put: async function (params) {
                return await http.put(this.url, params);
            },
            delete: async function (params) {
                return await http.delete(this.url, params);
            }
        }
    },
    level: {
        list: {
            url: `${config.API_URL}/course-level/list-page`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        all: {
            url: `${config.API_URL}/course-level/all`,
            name: "获取所有",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        action: {
            url: `${config.API_URL}/course-level`,
            name: "用户操作",
            post: async function (params) {
                return await http.post(this.url, params);
            },
            put: async function (params) {
                return await http.put(this.url, params);
            },
            delete: async function (params) {
                return await http.delete(this.url, params);
            }
        }
    },
    difficulty: {
        list: {
            url: `${config.API_URL}/course-difficulty/list-page`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        all: {
            url: `${config.API_URL}/course-difficulty/all`,
            name: "获取所有",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        action: {
            url: `${config.API_URL}/course-difficulty`,
            name: "用户操作",
            post: async function (params) {
                return await http.post(this.url, params);
            },
            put: async function (params) {
                return await http.put(this.url, params);
            },
            delete: async function (params) {
                return await http.delete(this.url, params);
            }
        }
    },
    book: {
        list: {
            url: `${config.API_URL}/course-book/list-page`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        all: {
            url: `${config.API_URL}/course-book/all`,
            name: "获取所有",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        action: {
            url: `${config.API_URL}/course-book`,
            name: "用户操作",
            post: async function (params) {
                return await http.post(this.url, params);
            },
            put: async function (params) {
                return await http.put(this.url, params);
            },
            delete: async function (params) {
                return await http.delete(this.url, params);
            }
        }
    },
    material: {
        list: {
            url: `${config.API_URL}/course-material/list-page`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        action: {
            url: `${config.API_URL}/course-material`,
            name: "用户操作",
            post: async function (params) {
                return await http.post(this.url, params);
            },
            put: async function (params) {
                return await http.put(this.url, params);
            },
            delete: async function (params) {
                return await http.delete(this.url, params);
            }
        }
    }
}